package hotciv.variant;

import hotciv.framework.*;
import hotciv.standard.*;

import java.util.ArrayList;
import java.util.List;

class AlphaCivWorldStrategy implements WorldSetupStrategy {

	public List<Tile> setupWorld(GameTesting g,List<Tile> world) {
		world = new ArrayList<Tile>();

		/** Place tiles in world */
		for ( int r = 0; r < Game.WORLDSIZE; r++ ) {
			for ( int c = 0; c < Game.WORLDSIZE; c++ ) {
				if ( r == 1 && c == 0 ) {
					world.add( new StandardTile(GameConstants.OCEANS, r, c ));
				} else if ( r == 0 && c == 1 ) {
					world.add( new StandardTile(GameConstants.HILLS, r, c ));
				} else if ( r == 2 && c == 2 ) {
					world.add( new StandardTile(GameConstants.MOUNTAINS, r, c ));
				} else {
					world.add( new StandardTile(GameConstants.PLAINS, r, c ));
				}
			}
		}

		/** Place units/cities on tiles in world */
		/**
		 * (1,1) red city
		 * (2,0) red archer
		 * (4,1) blue city
		 * (3,2) blue legion
		 */

		world.get(1 * Game.WORLDSIZE + 1).addCity(
				new StandardCity(StandardPlayer.RED,1));
		world.get(4 * Game.WORLDSIZE + 1).addCity(
				new StandardCity(StandardPlayer.BLUE,1));
		world.get(2 * Game.WORLDSIZE + 0).addUnit(
				new StandardUnit(GameConstants.ARCHER,StandardPlayer.RED));
		world.get(3 * Game.WORLDSIZE + 2).addUnit(
				new StandardUnit(GameConstants.LEGION,StandardPlayer.BLUE));

		return world;

	}
}